The present invention relates to methods of and systems arranged for reducing fragmentation. The invention also relates to corresponding computer program products.
A digital storage device is typically a disk on which data is stored. The present invention is concerned with such storage devices in which the data storage is potentially temporary, i.e. data is deletable.
When data, in the form of files, is stored to such a disk it is done so that each file is independently accessible. The files are stored on tracks arranged concentrically on the disk. The location on the disk at which a particular file is located is stored in a separate data structure in a disk management file.
Files are saved to the disk in one or more fragments. A fragment contains part or all of a file. When a large file is to be stored on the disk, several fragments may be required. Depending on the available space on the disk the fragments may be scattered around the disk surface. If the disk is near its capacity for data storage, even a relatively small file may have to be split into spaced fragments.
This spacing of fragments of a file is referred to as file fragmentation. When the free space between fragments becomes fragmented, this is referred to as free-space fragmentation. A highly fragmented disk generally will take longer to read as the read device needs to hunt around the disk to find the relevant fragments. Similarly it can take longer for a file to be saved to a highly fragmented disk as the write device needs to find sufficient fragments for all of the file(s), which clusters may be widely spaced. File fragmentation and free-space fragmentation are together referred to as fragmentation.
Various approaches have been tried to reduce fragmentation of such a memory device, for instance as disclosed in U.S. Pat. No. 5,930,828. In this prior art proposal files are moved around the disk to reduce fragmentation. This is time consuming and processor intensive.
In recent digital devices such as disk based digital video recorders using a file system, it is often the case that a file is to be deleted. For instance, a user may pre-select files for deletion (similar to a xe2x80x9crecycle binxe2x80x9d in a WINDOWS (trade mark) operating system environment) or files may be annotated only to be kept for a certain period of time. Such annotation is recorded in the system file manager usually by a marker flag. In this case there may be a plurality of files available for deletion when a delete operation needs to be carried out, for instance, to create space for a new file to be saved.
When a delete operation is necessary, it is desireable permanently to delete the minimum number of files so that (a) at least the required amount of free space is created; and (b) defragmentation and free-space defragmentation are optimised.
It is an aim of preferred embodiments of the present invention to provide a method, system and corresponding computer program product for reducing fragmentation of a digital storage device.
According to the present invention in a first aspect, there is provided a method of reducing fragmentation of a digital storage device, characterised by the method comprising the steps of:
determining that a plurality of files is available for deletion;
selecting one of the files; and
deleting the selected file and not deleting another of the files.
According to the present invention in a second aspect, there is provided a system arranged for reducing fragmentation of a digital storage device, characterised by the system comprising means for determining that a plurality of files is available for deletion; means for selecting one of the files; and means for deleting the selected file and not deleting another of the files.
It has been realised that with digital storage devices annotating a plurality of files for deletion, there is an efficient opportunity to reduce fragmentation by selective file deletion.